home *** CD-ROM | disk | FTP | other *** search
/ Delphi Programmer's Power Pack / Delphi Volume 1.iso / e_to_l / llocx1 / msvb.z / VIEWIMG.FRM < prev    next >
Text File  |  1996-02-13  |  7KB  |  246 lines

  1. VERSION 4.00
  2. Begin VB.Form WinSeek 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Image Viewer"
  6.    ClientHeight    =   6450
  7.    ClientLeft      =   2460
  8.    ClientTop       =   1725
  9.    ClientWidth     =   11370
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   0
  13.       weight          =   700
  14.       size            =   8.25
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H00000080&
  20.    Height          =   6855
  21.    Left            =   2400
  22.    MaxButton       =   0   'False
  23.    MinButton       =   0   'False
  24.    ScaleHeight     =   6450
  25.    ScaleWidth      =   11370
  26.    ShowInTaskbar   =   0   'False
  27.    Top             =   1380
  28.    Width           =   11490
  29.    Begin VB.CommandButton FitInHeight 
  30.       Caption         =   "Fit in &Height"
  31.       Height          =   345
  32.       Left            =   360
  33.       TabIndex        =   11
  34.       Top             =   5160
  35.       Width           =   1245
  36.    End
  37.    Begin VB.CommandButton FitRelease 
  38.       Caption         =   "&Release Fit"
  39.       Height          =   345
  40.       Left            =   360
  41.       TabIndex        =   10
  42.       Top             =   5640
  43.       Width           =   1230
  44.    End
  45.    Begin VB.CommandButton FitInWidth 
  46.       Caption         =   "Fit in &Width"
  47.       Height          =   345
  48.       Left            =   360
  49.       TabIndex        =   9
  50.       Top             =   4680
  51.       Width           =   1230
  52.    End
  53.    Begin VB.CommandButton FitBest 
  54.       Caption         =   "&Best Fit"
  55.       Height          =   345
  56.       Left            =   360
  57.       TabIndex        =   8
  58.       Top             =   4215
  59.       Width           =   1245
  60.    End
  61.    Begin VB.PictureBox Picture1 
  62.       BorderStyle     =   0  'None
  63.       Height          =   3015
  64.       Left            =   120
  65.       ScaleHeight     =   3015
  66.       ScaleWidth      =   4695
  67.       TabIndex        =   1
  68.       Top             =   120
  69.       Width           =   4695
  70.       Begin VB.DriveListBox drvList 
  71.          Height          =   315
  72.          Left            =   2040
  73.          TabIndex        =   6
  74.          Top             =   480
  75.          Width           =   2535
  76.       End
  77.       Begin VB.DirListBox dirList 
  78.          Height          =   1605
  79.          Left            =   2040
  80.          TabIndex        =   5
  81.          Top             =   960
  82.          Width           =   2535
  83.       End
  84.       Begin VB.FileListBox filList 
  85.          Height          =   2010
  86.          Left            =   120
  87.          TabIndex        =   4
  88.          Top             =   465
  89.          Width           =   1815
  90.       End
  91.       Begin VB.TextBox txtSearchSpec 
  92.          Height          =   285
  93.          Left            =   2040
  94.          TabIndex        =   3
  95.          Text            =   "*.*"
  96.          Top             =   0
  97.          Width           =   2535
  98.       End
  99.       Begin VB.Label lblCriteria 
  100.          Caption         =   "Files filter :"
  101.          Height          =   255
  102.          Left            =   120
  103.          TabIndex        =   2
  104.          Top             =   0
  105.          Width           =   1335
  106.       End
  107.    End
  108.    Begin VB.CommandButton cmdExit 
  109.       BackColor       =   &H00C0C0C0&
  110.       Caption         =   "E&xit"
  111.       Height          =   720
  112.       Left            =   120
  113.       TabIndex        =   0
  114.       Top             =   3240
  115.       Width           =   4575
  116.    End
  117.    Begin VB.Shape Shape1 
  118.       BorderWidth     =   3
  119.       Height          =   6135
  120.       Left            =   4920
  121.       Top             =   120
  122.       Width           =   6255
  123.    End
  124.    Begin LLILib.LLI Image1 
  125.       Height          =   6135
  126.       Left            =   4920
  127.       TabIndex        =   7
  128.       Top             =   120
  129.       Width           =   6255
  130.       _Version        =   65539
  131.       _ExtentX        =   11033
  132.       _ExtentY        =   10821
  133.       _StockProps     =   0
  134.       Blob            =   "ViewImg.frx":0000
  135.    End
  136. End
  137. Attribute VB_Name = "WinSeek"
  138. Attribute VB_Creatable = False
  139. Attribute VB_Exposed = False
  140. Option Explicit
  141. Dim SearchFlag As Integer   ' Used as flag for cancel and other operations.
  142.  
  143. Private Sub cmdExit_Click()
  144.     If cmdExit.Caption = "E&xit" Then
  145.         End
  146.     Else                    ' If user chose Cancel, just end Search.
  147.         SearchFlag = False
  148.     End If
  149. End Sub
  150.  
  151.  
  152.  
  153. Private Sub Command1_Click()
  154.     Image1.Fit 4
  155. End Sub
  156.  
  157. Private Sub Command2_Click()
  158.     Image1.Fit 1
  159. End Sub
  160.  
  161.  
  162. Private Sub Command3_Click()
  163.     Image1.Fit 0
  164. End Sub
  165.  
  166. Private Sub Command4_Click()
  167.     Image1.Fit 3
  168. End Sub
  169.  
  170.  
  171. Private Sub DirList_Change()
  172.     ' Update the file list box to synchronize with the directory list box.
  173.     filList.Path = dirList.Path
  174. End Sub
  175.  
  176. Private Sub DirList_LostFocus()
  177.     dirList.Path = dirList.List(dirList.ListIndex)
  178. End Sub
  179.  
  180. Private Sub DrvList_Change()
  181.     On Error GoTo DriveHandler
  182.     dirList.Path = drvList.Drive
  183.     Exit Sub
  184.  
  185. DriveHandler:
  186.     drvList.Drive = dirList.Path
  187.     Exit Sub
  188. End Sub
  189.  
  190. Private Sub filList_Click()
  191.  
  192.     If InStr(UCase(filList.FileName), ".BMP") > 0 Or InStr(UCase(filList.FileName), ".TIF") Or InStr(UCase(filList.FileName), ".JPG") Or InStr(UCase(filList.FileName), ".PNG") Then
  193.         Image1.FileName = dirList.Path + "\" + filList.FileName
  194.         WinSeek.Caption = "Image Viewer - " + dirList.Path + "\" + filList.FileName
  195.     Else
  196.         Beep
  197.     End If
  198. End Sub
  199.  
  200. Private Sub FitBest_Click()
  201.     Image1.Fit 4
  202. End Sub
  203.  
  204. Private Sub FitInHeight_Click()
  205.     Image1.Fit 2
  206. End Sub
  207.  
  208. Private Sub FitInWidth_Click()
  209.     Image1.Fit 3
  210. End Sub
  211.  
  212.  
  213. Private Sub FitRelease_Click()
  214.     Image1.Fit 0
  215. End Sub
  216.  
  217. Private Sub Form_Load()
  218.     Image1.CallBackCount = 0
  219.             ' When the CallBackCount is set to 0, the OCX is taking care of the Gauge
  220.             ' When the CallBackCount is set to x>0, the CallBack event is called during each process
  221. End Sub
  222.  
  223. Private Sub Form_Unload(Cancel As Integer)
  224.     End
  225. End Sub
  226.  
  227.  
  228. Private Sub LLI1_CallBack(ByVal ImageControl As Object, ByVal dwType As Long, ByVal dwAction As Long, ByVal dwDevice As Long, ByVal dwFormat As Long)
  229.     Beep
  230. End Sub
  231.  
  232. Private Sub LLI1_PostLoad(ByVal FileName As String)
  233.     'LLI1.Fit 4  ' Fit to the best
  234. End Sub
  235.  
  236. Private Sub txtSearchSpec_Change()
  237.     ' Update file list box if user changes pattern.
  238.     filList.Pattern = txtSearchSpec.Text
  239. End Sub
  240.  
  241. Private Sub txtSearchSpec_GotFocus()
  242.     txtSearchSpec.SelStart = 0          ' Highlight the current entry.
  243.     txtSearchSpec.SelLength = Len(txtSearchSpec.Text)
  244. End Sub
  245.  
  246.